package com.bk.service.address;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bk.entity.AddressInfo;
import com.bk.mapper.address.AddressMapper;

@Service /** 地址省市联动 */
public class AddressService {

	@Autowired
	private AddressMapper addressMapper;

	/** 获取所有省 */
	public List<AddressInfo> getAddressByLevel(int level) {

		List<AddressInfo> addList = addressMapper.getAddressByLevel(level);
		return addList;
	}

	/** 通过父类id查询子类城市 */
	public List<AddressInfo> getAddressByParentId(int parentId) {
		List<AddressInfo> addList = addressMapper.getAddressByParentId(parentId);
		return addList;
	}

}
